Kerry Back
from sklearn.model_selection import GridSearchCV
Fitting GridSearchCV does all of the following:
model = RandomForestRegressor( random_state=0 )
pipe = make_pipeline( transform, poly, transform, model )
param_grid = { "randomforestregressor__max_depth": [4, 6, 8] }
cv = GridSearchCV( pipe, param_grid=param_grid ) X = data[["roeq", "mom12m"]] y = data["rnk"] cv.fit(X, y) dump(cv, "forest2.joblib")
Later:
forest = load("forest2.joblib")